﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FigureDraw.Shapes.Effect
{
    public class MyHighlight : MyEffect
    {
        public MyHighlight()
        { 
        }

        public MyHighlight(MyShape shape)
            : base(shape)
        {
        }

        public override MyShape Clone()
        {
            return new MyHighlight(originalShape);
        }

        public override void Draw(Graphic.CommonGraphic graphic)
        {
            originalShape.StrokeColor = strokeColor;
            originalShape.BrushColor = BrushColor;
            originalShape.StrokeWidth = strokeWidth;
            originalShape.StartPoint = startPoint;
            originalShape.EndPoint = endPoint;
            base.Draw(graphic);

            MyShape shape = originalShape.Clone();

            shape.StrokeColor = new MyColorInfo(200, 200, 200);
            shape.StrokeWidth = 2 * originalShape.StrokeWidth;

            shape.Draw(graphic);
        }

        public override MyShape AttachEffect(MyShape shape)
        {
            return new MyHighlight(shape);
        }

        public override MyShape DetachEffect()
        {
            return originalShape;
        }
    }
}
